﻿Imports System.Data.OleDb
Public Class addTown
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub bn_Venue_Click(sender As Object, e As EventArgs) Handles bn_Town.Click
        Dim oleDbConn As New OleDb.OleDbConnection(ConfigurationManager.ConnectionStrings("soccerConnectionString").ConnectionString)
        Dim SqlString As String = "Insert Into Town(townName) Values (@f1)"
        Dim cmd As OleDbCommand = New OleDbCommand(SqlString, oleDbConn)
        cmd.CommandType = CommandType.Text
        cmd.Parameters.AddWithValue("@f1", tb_Town.Text)
        oleDbConn.Open()
        cmd.ExecuteNonQuery()
        Response.Redirect("venueconfirm.aspx")
    End Sub
End Class